Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added functionality to install the User variant of Stable Edition #2160

Merged
merged 7 commits into from
Sep 5, 2019

Conversation

Lothindir
Copy link
Contributor

@Lothindir Lothindir commented Aug 30, 2019

PR Summary

Added functionality to install the "User Install" variant of Stable Edition in the Install-VSCode.ps1 script. It works in the same way the Insiders Edition "User Install" does (see PR #1477). The deployement website already provides the installers.
Resolves Issue #2048

PR Checklist

Note: Tick the boxes below that apply to this pull request by putting an x between the square brackets.
Please mark anything not applicable to this PR NA.

  • PR has a meaningful title
  • Summarized changes
  • PR has tests NA
  • This PR is ready to merge and is not work in progress
    • If the PR is work in progress, please add the prefix WIP: to the beginning of the title and remove the prefix when the PR is ready

@msftclas
Copy link

msftclas commented Aug 30, 2019

CLA assistant check
All CLA requirements met.

@corbob
Copy link
Contributor

corbob commented Aug 30, 2019

This fixes #2048 right?

@Lothindir
Copy link
Contributor Author

Oh, yeah, I didn't see that it was an issue. I'll edit it to comply with the chosen Option 2

Copy link
Contributor

@corbob corbob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know which one is appropriate to use here either. It looks like all the parameters on the file use double quotes, and all the parameters on the internal function use single quotes. I'd probably leave the call to @rjmholt or @TylerLeonhardt to chime in on which they'd prefer, and if they'd ask it to be changed in this PR or a separate one.

@@ -132,7 +134,7 @@ param(
[string]$Architecture = "64-bit",

[parameter()]
[ValidateSet("Stable", "Insider-System", "Insider-User")]
[ValidateSet("Stable","Stable-User", "Insider-System", "Insider-User")]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know you didn't do it, but it bothers me that these are double quotes yet the same ValidateSet on line 204 is single quotes...

And a nit: space between comma and "Stable-User"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the script uses single quotes. I could change the double quotes when suitable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 2db94cf

Copy link
Member

@TylerLeonhardt TylerLeonhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good so far - thanks for tackling this! I left a couple comments.

@@ -1,6 +1,6 @@
<#PSScriptInfo

.VERSION 1.3
.VERSION 1.3.1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you're adding a feature, this would be 1.4.0. Can you update that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 96addda

scripts/Install-VSCode.ps1 Outdated Show resolved Hide resolved
Changed Stable to Stable-System as discussed in Issue PowerShell#2048.
scripts/Install-VSCode.ps1 Outdated Show resolved Hide resolved
$appName = "Visual Studio Code ($Bitness)"
break
}

'Stable-User' {
$appName = "Visual Studio Code ($($Architecture) - User)"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason you used $Architecture here instead of $Bitness like System?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I did the same as the Insiders Edition - user install.

Co-Authored-By: Tyler James Leonhardt <[email protected]>
@@ -439,7 +455,7 @@ function Install-VSCodeFromTar {

# We need to be running as elevated on *nix
if (($IsLinux -or $IsMacOS) -and (id -u) -ne 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like -User editions only apply on Windows (we could install anywhere on Linux from a tar and possibly the same on macOS, but it's likely more complexity than it's worth).

In that case, you might want to add another error message here when the $BuildEdition ends in User but we're on macOS or Linux, to say something like VSCode user installation is only supported on Windows

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a similar check at line 226.
It would fire after your suggestion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in b696783

Lothindir added a commit to Lothindir/vscode-powershell that referenced this pull request Sep 2, 2019
Added error message when the $BuildEdition ends in User but we're on macOS or Linux.
PowerShell#2160 (comment)
Added error message when the $BuildEdition ends in User but we're on Linux or MacOS
Copy link
Member

@TylerLeonhardt TylerLeonhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for adding this!

Co-Authored-By: Tyler James Leonhardt <[email protected]>
@rjmholt rjmholt merged commit 447a295 into PowerShell:master Sep 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants